<!DOCTYPE HTML>
<html>
  <head>
    <meta charset="[charset]">
    <title>[pageTitle]</title>
    <link rel="stylesheet" href="[styleSheet]"[mediaType] type="text/css" />
    [extraCSS][noLeftNav][noRightNav][upperScripts][errMsgStyle]
  </head>
<!-- Section Header End -->
<!-- Section PageBody Start -->
[blank]
  <body>
    <div id="script_version">[version]</div>
    <div id="wrapper">
[logo]
[topNav]
[leftNav]
[main]
[rightNav]
[footer]
    </div>
[lowerScripts]
  </body>
</html>
<!-- Section PageBody End -->
Individual sections are placed after this section. This comment should NEVER be visible on any page!
<!-- Section Logo Start -->
[blank]      <div id="logo">[pageTitleInfo]</div>
<!-- Section Logo End -->
<!-- Section TopNav Start -->
[blank]      <div id="top_nav">
[divDecoration]
        <ul>
[topNavLinks]
        </ul>
      </div>
<!-- Section TopNav End -->
You don't even have to place documentation within comment tags, since the sections
between the start and end section tags are the only parts of the template that are displayed.
<!-- Section LeftNav Start -->
[blank]      <div id="left_nav">
[divDecoration]
[navHeader]
        <ul>
[leftNavLinks]
        </ul>
      </div>
<!-- Section LeftNav End -->
<!-- Section Main Start -->
[blank]        <div id="errMsg" class="errMsg">
          <div class="closeButton" id="closeButton" onclick="closeStatus('errMsg')" title="Click to hide">&nbsp;</div>
[errMsg]
        </div>
      <div id="main">
[divDecoration]
        <div id="main_title">
          [mainTitle]
        </div>
        <div id="main_content">
[mainContent]
        </div>
      </div>
<!-- Section Main End -->
<!-- Section RightNav Start -->
[blank]      <div id="right_nav">
[divDecoration]
[navHeader]
[rightNavLinks]
      </div>
<!-- Section RightNav End -->
<!-- Section Footer Start -->
[blank]        <div id="footer">
[divDecoration]
          <div class="validXHTML">
            <a href="http://validator.w3.org/check?uri=referer">
              <img src="images/html5_valid.png" title="Valid HTML5" alt="Valid HTML5" height="31" width="88" style="border: none" />
            </a>
          </div>
          <div id="footer_content">
            [FooterInfo]
          </div>
          <div class="validCSS">
            <a href="http://jigsaw.w3.org/css-validator/check/referer">
              <img style="border:0;width:88px;height:31px" src="images/vcss.gif" alt="Valid CSS!" title="Valid CSS!" />
            </a>
          </div>
        </div>
<!-- Section Footer End -->
<!-- Section NavHeader Start -->
[blank]        <div class="nav_header">[headerTitle]</div>
<!-- Section NavHeader End -->
<!-- Section NavLink Start -->
[blank]          <li>
            <div[linkClass]>
[divDecoration]
            <a [linkHref][linkOnclick][linkTitle]>
              [linkLabel]
            </a>
            </div>
          </li>
<!-- Section NavLink End -->
<!-- Section DivDecoration Start -->
[blank]          <div class="ul"></div>
          <div class="ll"></div>
          <div class="ur"></div>
          <div class="lr"></div>
<!-- Section DivDecoration End -->
<!-- Section TitleSpan Start -->
[blank]      <div id="title">
        <div id="titlespan">
[divDecoration]
          <span class="orange">My</span> Program-O
        </div>
      </div>
<!-- Section TitleSpan End -->
<!-- Section NoRightNav Start -->
[blank]      <style type="text/css">
        #right_nav { display: none; }
        #main { right: 25px; }
      </style>
<!-- Section NoRightNav End -->
<!-- Section NoLeftNav Start -->
[blank]    <style type="text/css">
      #left_nav { display: none; }
      #main { left: 25px; }
    </style>
<!-- Section NoLeftNav End -->
<!-- Section ShowError Start -->
[blank]    <style type="text/css">
      .errMsg { display: block; }
    </style>
<!-- Section ShowError End -->
<!-- Section HideError Start -->
[blank]    <style type="text/css">
      .errMsg { display: none; }
    </style>
<!-- Section HideError End -->
<!-- Section ErrorMessage Start -->
[blank]        <div class="errMsg">[errorMessage]</div>
<!-- Section ErrorMessage End -->
<!-- Section LoginForm Start -->
[blank]        <div id="form_table">
          <fieldset>
            <legend>Login </legend>
            <form id="fm-form" method="post" action="index.php?page=login" >
              <div class="row center">
                <label for="user_name">Username:</label>
                <input name="user_name" id="user_name" type="text" maxlength="255" size="15"/>
              </div>
              <div class="row">
                <label for="pw">Password:</label>
                <input name="pw" id="pw" type="password" autocomplete="off" maxlength="255" size="15"/><br />
              </div>
              <div class="row">
                <input value="Submit" type="submit" />
              </div>
            </form>
          </fieldset>
        </div>
<!-- Section LoginForm End -->
<!-- Section ChangeBot Start -->
        <!--fieldset-->
          <form id="changebot" action="index.php?page=select_bots" method="post">
            <div>
              <label>Change Active Bot</label>
              <select name="bot_id" id="bot_id" onchange="submit()">
[options]
              </select>
              <input type="hidden" id="action" name="action" value="change"/>
              Bot ID:&nbsp;<input style="text-align: center" type="text" size="1" disabled="disabled" value="[bot_id]" /> (Not Editable)
            </div>
          </form>
        <!--/fieldset-->
<!-- Section ChangeBot End -->
<!-- Section SelectBotForm Start -->

[blank]    <!--fieldset-->
      <form id="botAttributes" action="index.php?page=select_bots" method="post">
        <div class="leftHalf noBorder">
          <table class="formTable">
            <tr>
              <td width="40%"><label for="bot_name"><span class="label">Bot Name</span></label></td>
              <td width="60%"><span class="formw"><input type="text"  class="fm-req" id="bot_name" name="bot_name" value="[bot_name]"/></span></td>
            </tr>
            <tr>
              <td><label for="bot_active"><span class="label">Bot Active</span></label></td>
              <td>
                <span class="formw">
                  <select name="bot_active" id="bot_active">
                    <option value="1" [sel_yes]>Yes</option>
                    <option value="0" [sel_no]>No</option>
                  </select>
                </span>
              </td>
            </tr>
            <tr>
              <td><label for="format"><span class="label">Response Format</span></label></td>
              <td>
                <span class="formw">
                  <select name="format" id="format">
                    <option value="html" [sel_html]>HTML</option>
                    <option value="xml" [sel_xml]>XML</option>
                    <option value="json" [sel_json]>JSON</option>
                  </select>
                </span>
              </td>
            </tr>
            <tr>
              <td><label for="unknown_user"><span class="label">Unknown User</span></label></td>
              <td>
                <span class="formw">
                  <input type="text" name="unknown_user" id="unknown_user" value="[bot_unknown_user]">
                </span>
              </td>
            </tr>
            <tr>
              <td><label for="debugemail"><span class="label">Debug Email Address</span></label></td>
              <td>
                <span class="formw">
                  <input type="text" name="debugemail" id="debugemail" value="[bot_debugemail]" />
                </span>
              </td>
            </tr>
            <tr>
              <td><label for="default_aiml_pattern"><span class="label">Default Pickup Line Pattern</span></label></td>
              <td>
                <span class="formw">
                  <input type="text" name="default_aiml_pattern" id="default_aiml_pattern" value="[bot_default_aiml_pattern]" />
                </span>
              </td>
            </tr>
            <tr>
              <td><label for="error_response"><span class="label">Error Response Message</span></label></td>
              <td>
                <span class="formw">
                  <input type="text" name="error_response" id="error_response" value="[bot_error_response]" />
                </span>
              </td>
            </tr>
            <tr>
              <td colspan="2" class="center"><span class="label">The chatbot "[bot_name]" has [aiml_count] AIML categories in the database.</span></td>
            </tr>
          </table>
        </div>
        <div class="rightHalf noBorder">
          <table class="formTable">
          <tr>
            <td width="40%"><label for="bot_desc"><span class="label">Bot Description</span></label></td>
            <td width="60%"><span class="formw">
              <textarea id="bot_desc" name="bot_desc">[bot_desc]</textarea>
            </span></td>
          </tr>
          <tr>
            <td><label for="bot_parent_id"><span class="label">Bot Parent Name</span></label></td>
            <td><span class="formw">
              <select name="bot_parent_id" id="bot_parent_id">
[parent_options]
              </select>
            </span></td>
          </tr>
          <tr>
            <td><label for="save_state"><span class="label">Save State</span></label></td>
            <td><span class="formw">
              <select name="save_state" id="save_state">
                    <option value="session" [sel_session]>Session</option>
                    <option value="database" [sel_db]>Database</option>
              </select>
            </span></td>
          </tr>
            <tr>
              <td><label for="default_remember_up_to"><span class="label">Bot History Lines</span></label></td>
              <td>
                <span class="formw">
                  <input type="text"  class="fm-req" id="remember_up_to" name="remember_up_to" value="[remember_up_to]"/>
                </span>
              </td>
            </tr>
          <tr>
            <td><label for="conversation_lines"><span class="label">Chat Lines To Display</span></label></td>
            <td><span class="formw">
              <input type="text"  class="fm-req" id="conversation_lines" name="conversation_lines" value="[bot_conversation_lines]"/>
            </span></td>
          </tr>
            <tr>
              <td><label for="debugmode"><span class="label">Debug Mode</span></label></td>
              <td>
                <span class="formw">
                  <select name="debugmode" id="debugmode">
                    <option value="0" [dm_]>source code view - show debugging in source code</option>
                    <option value="1" [dm_i]>file log - log debugging to a file</option>
                    <option value="2" [dm_ii]>page view - display debugging on the webpage</option>
                    <option value="3" [dm_iii]>email each conversation line (not recommended)</option>
                  </select>
                </span>
              </td>
            </tr>
          <tr>
            <td><label for="debugshow"><span class="label">Debug Level</span></label></td>
            <td><span class="formw">
              <select name="debugshow" id="debugshow">
                  <option value="0" [ds_]>Show no debugging</option>
                  <option value="1" [ds_i]>errors only</option>
                  <option value="2" [ds_ii]>general + errors</option>
                  <option value="3" [ds_iii]>general + errors + sql</option>
                  <option value="4" [ds_iv]>show everything</option>
              </select>
            </span></td>
          </tr>
          <tr>
            <td>
              <label for="useBranch">
                <span class="label">GitHub Branch to Check for Updates</span><span class="big red bold">*</span>
              </label>
            </td>
            <td>
              <select name="useBranch" id="useBranch">
                <option value="master"[bSelOptM]>Master</option>
                <option value="dev"[bSelOptD]>Development</option>
              </select>
            </td>
          </tr>
          </table>
        </div>
        <input type="hidden" id="bot_id" name="bot_id" value="[bot_id]"/>
        <div id="fm-submit" class="row fm-req center">
          <input type="submit" name="action" id="action" value="[action]"/>
        </div>
      </form>
      <div class="note">
        <span class="big red bold">*</span>Chooses the update branch on GitHub to check against the current install's version.
      </div>
    <!--/fieldset-->
<!-- Section SelectBotForm End -->
<!-- Section FormRow Start -->
      <div class="[leftRight]">
        <label for="[row_label]"><span class="label">[row_label]:</span></label>
        <span class="formw"><input name="[row_label]" id="[row_label]" value="[row_value]" /></span>
      </div>
<!-- Section FormRow End -->
<!-- Section ConversationLogs1 Start -->
        <div id="pTitle">[bot_name]'s Conversation Logs</div>
        <p>[convo]</p>
      </div>
<!-- Section ConversationLogs1 End -->
<!-- Section SpellcheckForm Start -->
        <fieldset style="margin-bottom: 3px;">
          <form id="spellCheck" action="index.php?page=spellcheck&amp;group=[group]" method="post">
            <div class="row bold">Add a Misspelled word and it's correction:</div>
            <div class="row fm-opt">
              <label for="missspell">Misspell: </label>
              <input type="text" id="missspell" name="missspell" />
            </div>
            <div class="row fm-opt">
              <label for="correction">Correction: </label>
              <input type="text" id="correction" name="correction" />
            </div>
            <div id="row fm-submit" class="fm-req">
              <input type="submit" name="action" id="action" value="add"/>
            </div>
            </form>
          </fieldset>
<!-- Section SpellcheckForm End -->
<!-- Section SearchSpellForm Start -->
          <fieldset style="margin-bottom: 3px;">
            <span>The Spell checker addon is <u>[sc_enabled]</u></span><br />
            <span>
              <strong>Note:</strong>
              To enable or disable the spell checker, you will need to edit the config file.
              Please see the README file in the chatbot/addons/spell_checker folder for more details.
            </span><br />
            <form id="search" action="index.php?page=spellcheck&amp;group=[group]" method="post">
            <div class="row bold">Search for a Misspelled word:</div>
              <div class="row fm-req">
                <input type="text" id="search" name="search" />
                <input type="submit" name="action" id="action" value="search"/>
              </div>
            </form>
          </fieldset>
<!-- Section SearchSpellForm End -->
<!-- Section EditSpellForm Start -->
        <fieldset style="margin-bottom: 3px;">
          <form id="spell" action="index.php?page=spellcheck&amp;group=[group]" method="post">
             <div class="row bold">Edit the entry for the Misspelled word [missspelling]:</div>
           <div class="row fm-opt">
              <label for="topic">Misspelling: </label>
              <input type="text" id="missspelling" name="missspelling" value="[missspelling]" />
            </div>
            <div class="row fm-opt">
              <label for="correction">Correction: </label>
              <input type="text" id="correction" name="correction"  value="[correction]" />
            </div>
            <div id="fm-submit" class="row fm-req">
              <input type="hidden" name="id" id="id" value="[id]"/>
              <input type="submit" name="action" id="action" value="update"/>
              <input type="submit" name="action" id="action" value="Delete" onclick="return confirm('Are you sure you want to delete this entry?');"/>
            </div>
          </form>
        </fieldset>
<!-- Section EditSpellForm End -->
<!-- Section WordCensorForm Start -->
        <fieldset style="margin-bottom: 3px;">
          <form id="wordCensor" action="index.php?page=wordcensor&amp;group=[group]" method="post">
            <div class="row bold">Add an improper word and it's replacement:</div>
            <div class="row fm-opt">
              <label for="word_to_censor">Bad word: </label>
              <input type="text" id="word_to_censor" name="word_to_censor" />
            </div>
            <div class="row fm-opt">
              <label for="replace_with">Replacement: </label>
              <input type="text" id="replace_with" name="replace_with" />
            </div>
            <div id="row fm-submit" class="fm-req">
              <input type="hidden" name="censor_id" value="[censor_id]" />
              <input type="submit" name="action" id="action" value="add" />&nbsp;
            </div>
            </form>
          </fieldset>
<!-- Section WordCensorForm End -->
<!-- Section SearchWordCensorForm Start -->
          <fieldset style="margin-bottom: 3px;">
            <form id="search" action="index.php?page=wordcensor&amp;group=[group]" method="post">
            <div class="row bold">Search for an improper word:</div>
              <div class="row fm-req">
                <input type="text" id="search" name="search" />
                <input type="submit" name="action" id="action" value="search"/>
              </div>
            </form>
          </fieldset>
<!-- Section SearchWordCensorForm End -->
<!-- Section EditWordCensorForm Start -->
        <fieldset style="margin-bottom: 3px;">
          <form id="wordCensor" action="index.php?page=wordcensor&amp;group=[group]" method="post">
             <div class="row bold">Edit the entry for the improper word [word_to_censor]:</div>
           <div class="row fm-opt">
              <label for="topic">Bad Word: </label>
              <input type="text" id="word_to_censor" name="word_to_censor" value="[word_to_censor]" />
            </div>
            <div class="row fm-opt">
              <label for="replace_with">Replacement: </label>
              <input type="text" id="replace_with" name="replace_with"  value="[replace_with]" />
            </div>
            <div id="fm-submit" class="row fm-req">
              <input type="hidden" name="censor_id" id="censor_id" value="[censor_id]"/>
              <input type="submit" name="action" id="action" value="update" />&nbsp;
              <input type="submit" name="action" id="action" value="Delete" onclick="return confirm('Are you sure you want to delete this entry?');"/>
            </div>
          </form>
        </fieldset>
<!-- Section EditWordCensorForm End -->
<!-- Section TeachMain Start -->
[blank]          <div id="teachForm" class="fullWidth noBorder">
[teach_content]
          </div>
          <div id="help">
[showHelp]
          </div>
<!-- Section TeachMain End -->
<!-- Section TeachBotForm Start -->
[blank]            <form id="teach" action="index.php?page=teach" method="post">
              <fieldset>
                <div class="row">
                  <label for="topic"><span class="twentyPercent">Topic: </span></label>
                  <span class="eightyPercent"><input name="topic" id="topic" class="wide" /></span>
                </div>
                <div class="row fm-opt">
                  <label for="thatpattern"><span class="twentyPercent">Previous Bot Response (THAT): </span></label>
                  <span class="eightyPercent"><input id="thatpattern" name="thatpattern" class="wide" /></span>
                </div>
                <div class="row fm-opt">
                  <label for="pattern"><span class="twentyPercent">User Input: </span></label>
                  <span class="eightyPercent"><input id="pattern" name="pattern" class="wide" /></span>
                </div>
                <div class="row fm-opt">
                  <label for="template"><span class="twentyPercent">Bot Response: </span></label>
                  <span class="eightyPercent"><textarea id="template" name="template" class="wide"></textarea></span>
                </div>
                <div class="row">For help, click the icon in the title, above.</div>
              <div id="row" class="fm-req">
                <input type="submit" name="action" id="action" value="teach"/>
              </div>
            </fieldset>
          </form>
<!-- Section TeachBotForm End -->
<!-- Section TeachShowHelp Start -->
[blank]            <div id="showHelp">
              <h3>Help...</h3>
              <dd>Adding a 'Topic' means that the bot will only be able to access this response if a previous aiml category has set this topic as it's current topic.</dd>
              <dd>The 'Previous Bot Response' means that the bot must have answered with this text in it's last response.</dd>
              <dd>The 'User Input' is the the users input used to access the bots response.</dd>
              <dd>The 'Bot Response' is the text the bot will output when the 'user Input' has been matched.</dd>
              <br />
              <h3>Simple Example</h3>
              <dd>User input: hello how are you</dd>
              <dd>Bot Response: I am well thank you and you?</dd>
              <br />
              <h3>Intermediate example:</h3>
              <dd>Previous Bot Response: I am well thank you and you</dd>
              <dd>User input: ok thanks </dd>
              <dd>Bot Response: That is great to hear</dd>
              <br />
              <h3>Advanced example:</h3>
              <dd>1. First response <u>MUST</u> set the topic</dd>
              <dd>User input: I like chatbots </dd>
              <dd>Bot Response: What do you like about them?<set topic="chatbots"></dd>
              <br />
              <dd>2. Second pattern can only be accessed because the topic has been set in the previous response</dd>
              <dd>Topic: chatbots</dd>
              <dd>User input: I just think they are cool </dd>
              <dd>Bot Response: Yes chatbots are cool </dd>
              <br />--You can find alot of information on the net about writing well formed aiml.<br />--If you want to learn more about writing AIML <a href="http://www.alicebot.org/documentation/aiml-primer.html" target="_new" class="hbox">start here</a>
            </div>
<!-- Section TeachShowHelp End -->
<!-- Section editAIMLShowHelp Start -->
[blank]            <div id="showHelp">
              <h2>Help...</h2>
              <h3>General/Searching</h3>
              <dd>
                Using the search/edit page is fairly straightforward. The page displays all of the available categories for the selected chatbot 10
                categories at a time by default, with options for displaying more, via a selectbox in the upper lef corner of the main panel, up to 100
                categories max. If the chatbot has more than 100 categories total in the database, there is a set of links for additional pages in the
                lower right corner of the panel, so that all stored AIML categories are accessible. The categories can be sorted by any of the visible
                fields, simply by clicking on the header titles along the top of the table.
              </dd>
              <dd>
                In order to quickly find the AIML category that you're looking for, simply use the search boxes along the top, just below the field titles.
                Any combination of search fields can be used at any time to help narrow the search.
              </dd>
              <dd></dd>
              <br />
              <h3>Editing</h3>
              <dd>
                Editing can be accomplished by simply clicking on the desired field and changing the contents of that field to suit your needs. You can
                cancel the edit at any time by pressing the Escape ([ESC]) key, or by "clicking off" the field without making any changes. To save your
                edit, simply "click off" the field once you're satisfied with the changes you've made. Please note, however, that the new AIML code that
                was saved is <strong>NOT</strong> checked for valid AIML code prior to saving, so it's up to you to make sure that the edited code is
                valid.
              </dd>
              <dd></dd>
              <br />
              <h3>Deleting a Category (row)</h3>
              <dd>
                In order to delete an AIML category from the database, simply locate it using the search functionality, then click on the DELETE icon
                (<img src="images/del.png" width="15" height="15" alt="">) to the left of the category. You will get a confirmation dialog prior to the
                deletion. <strong class="red">WARNING!</strong> Once you confirm that you want to delete the category, there is no going back! once deleted
                that AIML category is gone, and can only be "brought back" by creating a new one in it's place.
              </dd>
              <dd></dd>
              <br />--You can find alot of information on the net about writing well formed aiml.<br />--If you want to learn more about writing AIML <a href="http://www.alicebot.org/documentation/aiml-primer.html" target="_new" class="hbox">start here</a>
            </div>
<!-- Section editAIMLShowHelp End -->
<!-- Section ClearShowHelp Start -->
[blank]            <div id="showHelp">
              <h3>Help...</h3>
<dd>This area allows you remove individual or ALL aiml entries for a specific bot.</dd>
<dd>Ideal if you want to start again with a blank chatbot and repopulate via the upload panel.</dd>
<dd><strong>BUT BE WARNED:</strong> This operation can not be undone so use with care.</dd>
    <dd>--Ensure that the current bot is the correct bot.</dd>
    <dd>--Select 'Clear categories from this AIML file' and choose the aiml file from the drop down.</dd>
    <dd>--Or select 'Clear ALL AIML categories (Purge database)'.</dd>
    <dd>--Then press 'Submit' to delete the entries for that file.</dd>
            </div>
<!-- Section ClearShowHelp End -->
<!-- Section MembersShowHelp Start -->
[blank]           <div id="showHelp">
    <h3>Help...</h3>
    <dd>This area allows you edit or add users to the admin account area.</dd>
    <dd>--Select a current user.</dd>
    <dd>--Or enter the details for a new user.</dd>
    <dd>--Then press 'Save' to update the user.</dd>
    <dd>--Or press 'Delete' to remove the user.</dd>
</div>
<!-- Section MembersShowHelp End -->
<!-- Section UploadShowHelp Start -->
[blank]            <div id="showHelp">
              <h3>Help...</h3>
              <dd> If your aiml file will not upload you may want to check the following.</dd>
              <dd>--Make sure the folder you are trying to upload to has read/write privs on it (CHMOD 755)</dd>
              <dd>--Remove any comments from the aiml</dd>
              <dd>--Replace everything above the first &lt;cattegory&gt; with a simple &lt;aiml&gt; tag</dd>
              <br />--You can find alot of information on the net about writing well formed aiml.
              <br />--If you want to learn more about writing AIML <a href="http://www.alicebot.org/documentation/aiml-primer.html" target="_new" class="hbox">start here</a>
            </div>
<!-- Section UploadShowHelp End -->
<!-- Section DownloadShowHelp Start -->
[blank]            <div id="showHelp">
              <h3>Help...</h3>
              <dd>
                First, choose whether to download the files as AIML files (the default action)
                or as SQL files. Once you've made all of your selections, simply click the Download
                button, and your request will be processed. This processing should take only a few
                seconds. A link will be given on the off chance that your file doesn't pop up for
                downloading.
              </dd>
            </div>
<!-- Section DownloadShowHelp End -->
<!-- Section HelpLink Start -->
            <img src="images/help.png" onclick="showHide();" title="Click to toggle help" alt="Click to toggle help" style="cursor: pointer" />
<!-- Section HelpLink End -->
<!-- Section RSSItemTemplate Start -->
          <p>[rssRowTitle]</p>
          <p>[rssRowContent]</p>
          <br />
<!-- Section RSSItemTemplate End -->
<!-- Section LogoLink Start -->
        <div id="logoLink" onclick="[showHide]Logo()">[showHide] Logo</div>
<!-- Section LogoLink End -->
<!-- Section LogoLinkScript Start -->
[blank]    <script type="text/javascript" id="lowerScripts">
      function ShowLogo() {
        //setDisplay('1');
        var body = document.body;
        var bgi = 'url(images/repeated_header2.jpg)';
        body.style.backgroundImage = bgi;
        var logo = document.getElementById('logo');
        logo.style.display = "block";
        //var ts = document.getElementById('title');
        //ts.style.top = '125px';
        var topNav = document.getElementById('top_nav');
        if (topNav) topNav.style.top = '130px';
        var leftNav = document.getElementById('left_nav');
        if (leftNav) leftNav.style.top = '160px';
        var main = document.getElementById('main');
        main.style.top = '160px';
        var rightNav = document.getElementById('right_nav');
        if (rightNav) rightNav.style.top = '160px';
      }
      function HideLogo() {
        //setDisplay('HideLogoCSS');
        var body = document.body;
        var bgi = 'none';
        body.style.backgroundImage = bgi;
        var logo = document.getElementById('logo');
        logo.style.display = "none";
        var topNav = document.getElementById('top_nav');
        topNav.style.top = '15px';
        var leftNav = document.getElementById('left_nav');
        if (leftNav) leftNav.style.top = '50px';
        var main = document.getElementById('main');
        main.style.top = '50px';
        var rightNav = document.getElementById('right_nav');
        if (rightNav) rightNav.style.top = '50px';
      }
      function toggleLogo() {
        if (logoStatus == 'Hide') {
          logoStatus = 'Show';
          ShowLogo();
        }
        else {
          logoStatus = 'Hide';
          HideLogo();
        }
        setCookie('display', logoStatus);
      }

      function setCookie(name, value) {
        document.cookie = name + '=' + escape(value) + ';path=/';
      }
      function getCookie(name) {
        var dc = document.cookie;
        var begin = dc.indexOf(name);
        if (begin < 0) return false;
        var end = (dc.indexOf(";", begin) == -1) ? dc.length : dc.indexOf(";", begin);
        return unescape(dc.substring((begin + (name.length + 1)), end));
      }
      function closeStatus(element) {
        var parent = document.getElementById(element);
        parent.style.display = 'none';
      }
      function openStatus(element) {
        var parent = document.getElementById(element);
        parent.style.display = 'block';
      }
      //var logoStatus = (getCookie('display') !== false) ? 'Hide' : 'Show';
      var logoStatus = getCookie('display');
      logoStatus = (logoStatus == 'Hide' || logoStatus == 'Show') ? logoStatus : 'Show';
      var func = logoStatus + 'Logo()';
      setTimeout(function(){
        eval(func);
        //alert('logoStatus = ' + logoStatus);
      },10);
      //var x = eval(func);
    </script>
<!-- Section LogoLinkScript End -->
<!-- Section HideLogoCSS Start -->
    <style type="text/css">
      body { background-image: none; }
      #logo { display: none; }
      #top_nav { top: 15px; }
      #left_nav, #right_nav, #main { top: 50px; }
    </style>
<!-- Section HideLogoCSS End -->
<!-- Section ChatDemo Start -->
        <div id="demoChatTitle">Talk to [bot_name] using the [format] interface:</div>
        <div id="demoChatContainer"><iframe id="demoChat" src="[pageSource]"></iframe></div>
<!-- Section ChatDemo End -->
<!-- Section DbStats Start -->
[blank]        <div id="dbStatsTitle">Database Stats for [dbn]</div>
        <div id="dbStatsContainer">
          <p>Uptime: [stats_uptime]</p>
          <p>Threads: [stats_threads]</p>
          <p>Queries: [stats_query_count]</p>
          <p>Slow queries: [stats_slow_queries]</p>
          <p>Flush table count: [stats_flush_count]</p>
          <p>Tables Opened: [stats_tables_open]</p>
          <p>Queries per second avg: [stats_qps]</p>
        </div>
<!-- Section DbStats End -->
<!-- Section MembersMain Start -->
[blank]<div id="membersForm" class="fullWidth noBorder">
            <p>
              Here's where you add, remove or edit admin accounts.
            </p>
[members_list_form]
[members_content]
          </div>
          <div id="help">
[showHelp]
          </div>
<!-- Section MembersMain End -->
<!-- Section MembersForm Start -->
[blank]          <p><strong>[action] Admin Account:</strong></p>
            <form id="members" action="index.php?page=members" method="post">
              <fieldset class="noBorder">
                <div class="row">
                  <input name="id" id="id" value="[id]" autocomplete="off" disabled="disabled" />
                  Account ID: (<u>not editable</u>)
                </div>
                <div class="row">
                  <input name="user_name" id="user_name" value="[user_name]" />
                  <label for="user_name">Login Name: </label>
                </div>
                <div class="row">
                  <input name="password" id="password" type="password" autocomplete="off">
                  <label for="password">Password: </label>
                </div>
                <div class="row">
                  <input name="passwordConfirm" id="passwordConfirm" type="password" autocomplete="off">
                  <label for="passwordConfirm"> Confirm Password: </label>
                </div>
                <div class="row">
                  <input type="hidden" name="id" id="id" value="[id]" />
                  <input type="submit" name="action" value="[action]" />
                  <input type="submit" name="action" value="Delete" />
                </div>
              </fieldset>
            </form>
<!-- Section MembersForm End -->
<!-- Section MembersListForm Start -->
[blank]            <div class="row">
              <form id="memberList" action="index.php?page=members" method="post">
                <fieldset class="noBorder">
                  <label for="memberSelect">Current Admins: </label>
                  <select name="memberSelect" id="memberSelect" size="1">
                    <option value="-1">Select an Admin</option>
[adminList]
                  </select>
                  <input type="hidden" name="action" value="editfromlist" />
                  <input type="submit" name="" value="Edit User" />
              </fieldset>
              </form>
            </div>
<!-- Section MembersListForm End -->
<!-- Section UploadMain Start -->
[blank]          <div id="uploadForm" class="fullWidth noBorder">
            <p>
              Use this uploader to add AIML categories to your chatbot's database. You have the option
              to upload either individual AIML files, or ZIP archive files of up to 2MB in size.
              This uploader no longer performs XML validation, so you need to validate your AIML files prior to
              uploading them. It's <strong><u>STRONGLY SUGGESTED</u></strong> that you use either W3School's
              <a href="http://www.w3schools.com/xml/xml_validator.asp" target="_blank">XML Validator</a>,
              or the <a href="validateAIML.php">Program O AIML Validator</a>. There are other XML validators
              available, but the W3Schools validator works well, and the Program O Validator is specifically
              designed to validate AIML files. Please note, however, that neither of the above mentioned
              validators will work with zip files.
            </p>
[upload_content]
            <hr />
            <div id="AIML_List">
              List of Currently Stored AIML files for [bot_name]:<br />
[AIML_List]
            </div>
            <hr />
          </div>
          <div id="help">
[showHelp]
          </div>
<!-- Section UploadMain End -->
<!-- Section UploadAIMLForm Start -->
[blank]            <form id="upload" enctype="multipart/form-data"  action="" method="post">
          <table class="formTable">
            <tr>
              <td>
                  <label for="aimlfile">File:</label>
                  <input type="file" id="aimlfile" name="aimlfile" onchange="checkSize();" />&nbsp; &nbsp;
              </td>
              <td>
                  <input type="checkbox" id="clearDB" name="clearDB" checked="checked" />&nbsp; &nbsp;
                  <label for="clearDB">Clear the database of entries from this file</label>
              </td>
            </tr>
            <tr>
              <td colspan="2">
                  <label for="bot_id">Apply this file to this bot: </label>
                  <select name="bot_id" id="bot_id" size="1">
[all_bots]
                  </select>&nbsp; &nbsp;
              </td>
            </tr>
            <tr>
              <td colspan="2">
                  <input type="submit" name="action" id="action" value="upload"/>
              </td>
            </tr>
          </table>
            </form>
<!-- Section UploadAIMLForm End -->
<!-- Section editSRAIPage Start -->
[blank]          <link rel="stylesheet" href="https://cdn.datatables.net/1.10.12/css/jquery.dataTables.min.css" />
          <style type="text/css">
            .dataTables_wrapper .dataTables_paginate .paginate_button  { padding: 0; }
            table.dataTable tbody th, table.dataTable tbody td, table.dataTable thead th, table.dataTable thead td { padding: 1px 2px 1px 0; }
            input.search-input-text { margin-left: -14px; }
            #showHelp { top: -15px; }
          </style>
          <div class="row center">
            The SRAI lookup table currently contains [row_count] entries for the chatbot named "[bot_name]".
          </div>
          <p>
            <a href="?page=srai_lookup&amp;action=fillLookup">Fill Lookup Table</a>&nbsp;(See the HELP link for details)
          </p>
          <hr class="w80 m0a mb5">
          <div class="holder">
            <table id="SRAI_LOOKUP" class="datatable-table">
              <thead>
                <tr>
                  <th title="Sort by Table ID">ID</th>
                  <th title="Sort by Bot ID">Bot ID</th>
                  <th title="Sort by Pattern">Pattern</th>
                  <th title="Sort by Template ID">Template ID</th>
                </tr>
              </thead>
              <thead>
                <tr class="filters">
                  <th id="f_id"><input type="text" data-column="0"  class="search-input-text" placeholder="ID Search"></th>
                  <th id="f_bot_id"><input type="text" data-column="1"  class="search-input-text" placeholder="bot ID Search"></th>
                  <th id="f_pattern"><input type="text" data-column="2"  class="search-input-text" placeholder="pattern Search"></th>
                  <th id="f_template_id"><input type="text" data-column="3"  class="search-input-text" placeholder="template ID Search"></th>
                </tr>
              </thead>
            </table>
            <form id="addNewCat">
              <table id="newCatTable">
                  <tr>
                    <td colspan="4" class="center bold">Add New SRAI Entry:</td>
                  </tr>
                  <tr>
                     <td class="w5">
                       <input id="btnClearNewCat" name="" type="reset" value="Clear Form">
                     </td>
                    <td class="w15">
                      <textarea name="bot_id" rows="2" placeholder="Bot ID" class="newCat"></textarea>
                    </td>
                    <td class="w55">
                      <textarea name="pattern" rows="2" placeholder="Pattern" class="newCat"></textarea>
                    </td>
                    <td class="w15">
                      <textarea name="template_id" rows="2" placeholder="Template ID" class="newCat"></textarea>
                    </td>
                   <td class="w10">
                     <input id="btnSaveNewCat" name="" type="submit" value="Save Category">
                     <input type="hidden" name="action" value="add" />
                   </td>
                  </tr>
              </table>
            </form>
            <div class='search-msg'></div>
          </div>
[showHelp]
          <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
          <script type="text/javascript" src="//cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>
          <script type="text/javascript" src="scripts/editSRAI.js"></script>
<!-- Section editSRAIPage End -->
<!-- Section editSRAIShowHelp Start -->
[blank]            <div id="showHelp">
              <h2>Help...</h2>
              <h3>General</h3>
              <dd>
                The "Fill Lookup Table" link runs a script that searches the entire AIML table for SRAI calls for every chatbot
                and stores valid entries (along with the bot ID and the IDs of categories with matching patterns)
                into a special lookup table. The chatbot engine then uses this lookup table to select the proper
                response for that SRAI call without having to search through the entire database for a "best match".
                This can improve performance by as much as 70% for each SRAI call made that is in the lookup table.
                Since the script runs for all current chatbots, you only have to run it once for all of your bots.
                Just remember to run it again if you make any significant changes to your AIML, especially if you
                add or remove a chatbot. You don't have to worry about duplicates because the script starts by
                emptying the lookup table first, and then uses a routine that rejects duplicates on a per-bot basis.
              </dd>
              <dd>
                The table and forms on the page are to help with searching for, editing, and inserting new entries within the
                srai_lookup table. These aids are here mainly because the script that automatically inserts entries into
                the table is far from perfect, and can often miss entries due to SRAI calls that contain other AIML tags.
                The use of these tools requires a great deal of knowledge regarding the content of the chatbot's AIML, and
                should be used with caution until you become proficient with the ins and outs of your chatbot's AIML code.
              </dd>
              <h3>Warning:</h3>
              <dd>
                Please note that if you have any manually edited entries in the srai_lookup table and run the script to
                populate the table anew, all of those manually added entries will be lost. So before you run the script
                to repopulate the table, you should use a database manager (such as phpMyAdmin) to back up those entries.
              </dd>
              <br />
              <h3>Editing</h3>
              <dd>
                Editing can be accomplished by simply clicking on the desired field and changing the contents of that field to suit your needs. You can
                cancel the edit at any time by pressing the Escape ([ESC]) key, or by "clicking off" the field without making any changes. To save your
                edit, simply "click off" the field once you're satisfied with the changes you've made. Please note, however, that the new AIML code that
                was saved is <strong>NOT</strong> checked for valid AIML code prior to saving, so it's up to you to make sure that the edited code is
                valid.
              </dd>
              <dd></dd>
              <br />
              <h3>Deleting a Category (row)</h3>
              <dd>
                In order to delete an SRAI entry from the database, simply locate it using the search functionality, then click on the DELETE icon
                (<img src="images/del.png" width="15" height="15" alt="">) to the left of the category. You will get a confirmation dialog prior to the
                deletion. <strong class="red">WARNING!</strong> Once you confirm that you want to delete the category, there is no going back! once deleted
                that AIML category is gone, and can only be "brought back" by creating a new one in it's place.
              </dd>
            </div>
<!-- Section editSRAIShowHelp End -->
<!-- Section StatsPage Start -->
[blank]          <div id="nocol">
            <h2>[bot_name]'s Stats</h2>
            <div class="leftHalf">
              <b><u>Conversations: </u></b><br />
              Today: [oneday]<br />
              Last week: [oneweek]<br />
              Last month: [onemonth]<br />
              Last six months: [sixmonths]<br />
              Last year: [oneyear]<br />
              All time: [alltime]
            </div>
            <div class="rightHalf">
              <b><u>Conversation Lines:</u></b><br />
              Single line: [singlelines]<br />
              1-25 lines: [alines]<br />
              25-50 lines: [blines]<br />
              51-100 lines: [clines]<br />
              101+ lines: [dlines]<br />
              Average: [avg]
            </div>
          </div>
<!-- Section StatsPage End -->
<!-- Section EditAimlPage Start -->
[blank]          <link rel="stylesheet" href="https://cdn.datatables.net/1.10.12/css/jquery.dataTables.min.css" />
          <style type="text/css">
            .dataTables_wrapper .dataTables_paginate .paginate_button  { padding: 0; }
            table.dataTable tbody th, table.dataTable tbody td, table.dataTable thead th, table.dataTable thead td { padding: 1px 2px 1px 0; }
            input.search-input-text { margin-left: -14px; }
            #showHelp { top: -15px; }
          </style>
          <div class="holder">
            <table id="AIML" class="datatable-table">
              <thead>
                <tr>
                  <th title="Sort by Table ID">ID</th>
                  <th title="Sort by User input">Pattern</th>
                  <th title="Sort by Previous bot response">thatpattern</th>
                  <th title="Sort by Bot response">Template</th>
                  <th title="Sort by Topic">Topic</th>
                  <th title="Sort by File">Filename</th>
                </tr>
              </thead>
              <thead>
                <tr class="filters">
                  <th id="f_id"><input type="text" data-column="0"  class="search-input-text" placeholder="ID Search"></th>
                  <th id="f_pattern"><input type="text" data-column="1"  class="search-input-text" placeholder="pattern Search"></th>
                  <th id="f_thatpattern"><input type="text" data-column="2"  class="search-input-text" placeholder="thatpattern Search"></th>
                  <th id="f_template"><input type="text" data-column="3"  class="search-input-text" placeholder="template Search"></th>
                  <th id="f_topic"><input type="text" data-column="4"  class="search-input-text" placeholder="topic Search"></th>
                  <th id="f_filename"><input type="text" data-column="5"  class="search-input-text" placeholder="filename Search"></th>
                </tr>
              </thead>
            </table>
            <form id="addNewCat">
              <table id="newCatTable">
                  <tr>
                    <td colspan="6" class="center bold">Add new AIML Category:</td>
                  </tr>
                  <tr>
                     <td class="w5">
                       <input id="btnClearNewCat" name="" type="reset" value="Clear Form">
                     </td>
                    <td class="w15">
                      <textarea name="pattern" rows="2" placeholder="User input" class="newCat"></textarea>
                    </td>
                    <td class="w15">
                      <textarea name="thatpattern" rows="2" placeholder="Previous bot Response" class="newCat"></textarea>
                    </td>
                    <td>
                      <textarea name="template" rows="2" placeholder="Bot response" class="newCat"></textarea>
                    </td>
                    <td class="w15">
                      <textarea name="topic" rows="2" placeholder="Topic" class="newCat"></textarea>
                    </td>
                   <td class="w10">
                     <input id="btnSaveNewCat" name="" type="submit" value="Save Category">
                     <input type="hidden" name="filename" value="admin_added.aiml" />
                     <input type="hidden" name="action" value="add" />
                   </td>
                  </tr>
              </table>
            </form>
            <div class='search-msg'></div>
          </div>
[showHelp]
          <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
          <script type="text/javascript" src="//cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>
          <script type="text/javascript" src="scripts/editAiml.js"></script>
<!-- Section EditAimlPage End -->
<!-- Section DataTable Start -->
[blank]      <div class="editaiml-table">
        <div class='search-msg'></div>
          <table id="[table_id]" class="datatable-table">
            <thead class="datatable-columns">
[thead_content]
            </thead>
            <tfoot>
[tfoot_content]
            </tfoot>
            <tbody>
[tbody_content]
            </tbody>
          </table>
        </div>
<!-- Section DataTable End -->
<!-- Section DownloadForm Start -->
[blank]          <div id="downloadFormMulti" class="fullWidth noBorder downloadForms">
            <div class="row center">Please select the AIML files you wish to download from the selections below.</div>
            <hr class="eightyPercent">
            <form action="index.php?page=download" method="POST" id="downloadForm">
              <table class="centered">
                <tr>
                  <td class="center">
                    <input type="radio" name="type" id="actionGetFileAIML" checked="checked" value="AIML">
                    <label for="actionGetFileAIML" style="width: 250px">Download files as AIML</label>
                  </td>
                  <td class="center">
                    <input type="checkbox" id="cbSelectAll">
                    <label for="cbSelectAll" style="width: 250px">Select all files</label>
                  </td>
                  <td class="center">
                    <input type="radio" name="type" id="actionGetFileSQL" value="SQL">
                    <label for="actionGetFileSQL" style="width: 250px">Download files as SQL</label>
                  </td>
                </tr>
                <tr>
                  <td colspan="3" class="center">
                    <hr class="eightyPercent">
                  </td>
                </tr>
                <tr>
                  <td colspan="3" class="center">
[file_checkboxes]
                  </td>
                </tr>
                <tr>
                  <td colspan="3" class="center">
                    <hr class="eightyPercent">
                  </td>
                </tr>
                <tr>
                  <td colspan="3" class="center">
                    <input type="submit" id="btnCBSub" value="Download Zip">
                  </td>
                </tr>
              </table>
            </form>
            <div id="status">[status]</div>
          </div>
[showHelp]
          <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
          <script type="text/javascript">
            $(function(){
              $('#cbSelectAll').click(function(){$('.cbFiles').prop('checked', $(this).prop('checked'));});
            });
          </script>
<!-- Section DownloadForm End -->
<!-- Section UpperScripts Start -->
[blank]    <script type="text/javascript">
      function showMe() {
        var sh = document.getElementById('showHelp');
        var tf = document.getElementById('membersForm');
        sh.style.display = 'block';
        tf.style.display = 'none';
      }
      function hideMe() {
        var sh = document.getElementById('showHelp');
        var tf = document.getElementById('membersForm');
        sh.style.display = 'none';
        tf.style.display = 'block';
      }
      function showHide() {
        var display = document.getElementById('showHelp').style.display;
        switch (display) {
          case '':
          case 'none':
            return showMe();
            break;
          case 'block':
            return hideMe();
            break;
          default:
            alert('display = ' + display);
        }
      }
    </script>
<!-- Section UpperScripts End -->
<!-- Section ClearAIML Start -->
[blank]          <div class="bold red center">Deleting AIML categories from the database is <strong>permanent</strong>!
          This action <strong>CANNOT</strong> be undone!</div>
          <div id="clearForm">
          <form name="clearForm" action="index.php?page=clear" method="POST" onsubmit="return verify()">
          <table class="formTable">
            <tr>
              <td>
                <input type="radio" name="action" value="void" id="actionClearFile" checked="checked">
                <label for="actionClearFile" style="width: 210px; text-align: left">Clear categories from this AIML file: </label><br />
              </td>
              <td>
                <input type="radio" name="action" id="actionClearAll" value="clear">
                <label for="actionClearAll" style="width: 250px">Clear <strong>ALL</strong> AIML categories (Purge database)</label>
              </td>
            </tr>
            <tr>
              <td colspan="2">
                <select name="clearFile" id="clearFile" size="1" style="margin: 14px;" onclick="document.getElementById('actionClearFile').checked = true" onchange="document.getElementById('actionClearFile').checked = true">
                  <option value="null" selected="selected">Choose a file</option>
[selectOptions]
                </select>
              </td>
            </tr>
            <tr>
              <td colspan="2">
                <input type="submit" name="" value="Submit">
              </td>
            </tr>
          </table>
          </form>
          </div>
[showHelp]
          <script type="text/javascript">
            function verify()
{


              var fn = document.getElementById('clearFile').value;
              var clearAll = document.getElementById('actionClearAll').checked;
              if (fn == 'null' && clearAll === false) return false;
              if (clearAll) fn = 'repository for all files';
              return confirm('This will delete all categories from the AIML file ' + fn + '! This cannot be undone! Are you sure you want to do this?');
            }
          </script>
<!-- Section ClearAIML End -->
<!-- Section BugForm Start -->
[blank]      <form method="POST" action="index.php?page=bugs" name="contactForm">
        <input name="func" value="sendMail" type="hidden">
        <input name="contactMe" value="true" type="hidden">
        <table border="1" width="100%">
          <tr>
            <td align="center" width="33%">
              Your Name:<br />
              <input name="name" value="" type="text">
            </td>
            <td align="center">
              Your Email Address:<br />
              <input name="email" value="[debugemail]" type="text">
            </td>
            <td align="center" width="33%">
              Subject:<br />
              <input name="subject" value="Bug Report Submission" type="text">
            </td>
          </tr>
          <tr>
            <td colspan="3" align="center">
              Message:<br />
              <textarea rows="7" id="report_message" name="message" placeholder="Your Message Here..."></textarea>
            </td>
          </tr>
          <tr>
            <td>
              <p class="indent">
                Use this handy form to submit a bug report to Liz and Company over at the Program O website.
                Please describe the problem as completely as possible, including what actions you were trying
                to perform at the time that you noticed the problem.
              </p>
            </td>
            <td align="center">
              <img id="capImg" src="captcha.php" title="Captcha script ©2009-2011 Geek Cave Creations"><br />
              <input onclick="renewImage(); return false" value="Refresh" type="button">
            </td>
            <td>
              <p class="indent">
                Answer the question you see in the image on the left into the text area
                below. We are looking for a one word answer (no numbers). Sorry, but bots are not allowed.
              </p>
              <input name="captcha" type="text">
            </td>
          </tr>
          <tr>
            <td colspan="4" align="center">
              <input name="Post" id="report_submit" value="Submit Bug Report" type="submit">
            </td>
          </tr>
        </table>
      </form>
      <script type="text/javascript">
        function renewImage() {
          var url = 'captcha.php?r=' + Math.random();
          document.getElementById('capImg').src = url;
        }
      </script>
<!-- Section BugForm End -->
